<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head>
<!--
----	(c) Copyright 2004-2006 by Russell Smith

----    This program is free software; you can redistribute it and/or modify
----    it under the terms of the GNU General Public License as published by
----    the Free Software Foundation; only version 2 of the License.
----
----    This program is distributed in the hope that it will be useful,
----    but WITHOUT ANY WARRANTY; without even the implied warranty of
----    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
----    GNU General Public License for more details.
----
----    You should have received a copy of the GNU General Public License
----    along with this program; if not, write to the Free Software
----    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
----    02110-1301, USA.
-->
    <title>Stratagus Configuration Language Description: Save Game Files</title>
    <meta name="Author" content="johns98@gmx.net">
    <meta name="Keyword" content="ccl,tileset">
    <meta name="Description" content="">
</head>
<body>
<pre width=80>
         _________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
           Stratagus - A free fantasy real time strategy game engine
</pre>
<hr>
<h1>Stratagus Configuration Language Description: Triggers</h1>
<hr>
<a href="../index.html">Stratagus</a>
<a href="../faq.html">FAQ</a>
<a href="research.html">PREV</a>
<a href="sound.html">NEXT</a>
<a href="index.html">LUA Index</a>
<hr>
<a href="#SaveGame">SaveGame</a>
<a href="#SlotUsage">SlotUsage</a>
<hr>
<h2>Intro - Introduction to savegame functions and variables</h2>

Everything around save games. All of the functions below are primarily used
in the creation and loading of saved games.
<h2>Functions</h2>

<a name="SaveGame"></a>
<h3>SaveGame({SyncHash = x, SyncRandSeed = y, SaveFile = "file"})</h3>

Basic outline of the savegame, include hashs for syncrand and where to load
the rest of the game information from when loading. More information is planed
for implementation, but currently only the above are used.

<dl>
<dt>SyncHash = x</dt>
<dd>integer setting the Hash of the current game for Sync Purposes</dd>
<dt>SyncRandSeed = y</dt>
<dd>integer of the next value to be used when calling SyncRand</dd>
<dt>SaveFile = "file"</dt>
<dd>String containing the name of the file to load to get the rest of the gamedata</dd>
</dl>

<h4>Example</h4>

<pre>
SaveGame({
---  "comment", "Generated by Stratagus Version 2.2",
---  "comment", "Visit https://launchpad.net/stratagus for more informations",
---  "type",    "single-player",
---  "date",    "Mon May 10 19:19:38 2004",
---  "map",     "",
---  "media-version", "Undefined"---  "engine",  {2, 0, 0},
     SyncHash = 196009203,
     SyncRandSeed = -220040269,
     SaveFile = "data.wc2//campaigns/human/level13h.cm"

---  "preview", "/home/devil/.stratagus/wc2/save/current-game.sav.pam",
} )
</pre>

<a name="SlotUsage"></a>
<h3>SlotUsage(MaxSlot, [{Slot = Slot1, FreeCycle = Freecycle1}, ..])</h3>

Allows reloaded Save games to be replayed in sync by reloading the released
units back into the queue they were in when a game was saved.
<dl>
<dt>MaxSlot</dt>
<dd>The total Number of slot used.</dd>
<dt>Slot</dt>
<dd>The Slot Number for the unit that was in the release Queue</dd>
<dt>FreecCycle</dt>
<dd>The Cycle that this unit is/was released in</dd>
</dl>

<h4>Example</h4>
<pre>
    SlotUsage(5, {2, 855})
</pre>

<hr>
(C) Copyright 2002-2015 by The <a href="https://launchpad.net/stratagus">Stratagus</a> Project under the <a href="../gpl.html">GNU General Public License</a>.<br>
All trademarks and copyrights on this page are owned by their respective owners.<br>
</body>
</html>
